import request from "@/request/index.js";

const auth = "auth"; //http://101.42.107.47:30019文档
const base = "base"; //http://101.42.107.47:30020文档
const zhpt = "zhpt"; //http://101.42.107.47:30018文档

//上传文件 -- 返回path
export const uploadFilePathApi = (data) => {
    return request({
        url: `/api/${zhpt}/files/upload/path`,
        method: 'post',
        headers: {
            'Content-Type':'"multipart/form-data"'
        },
        data,
    })
}
//上传文件 -- 返回id
export const uploadFileApi = (data) => {
    return request({
        url: `/api/${zhpt}/files/upload`,
        method: 'post',
        headers: {
            'Content-Type':'"multipart/form-data"'
        },
        data,
    })
}

//上传图片返回url
export const uploadImgGetUrlApi = (data) => {
    return request({
        url: `/api/${zhpt}/files/upload/path`,
        method: 'post',
        headers: {
            'Content-Type':'"multipart/form-data"'
        },
        data,
    })
}

//需求成果上传模板文件
export const uploadOtherFileApi = (data) => {
    return request({
        url: `/api/${zhpt}/import/data`,
        method: 'post',
        headers: {
            'Content-Type':'"multipart/form-data"'
        },
        data,
    })
}

//需求成果下载模板文件
export const dowloadOtherFileApi = (params) => {
    return request({
        url: `/api/${zhpt}/import/template`,
        method: 'GET',
        params,
        responseType: 'blob',
    })
}